package com.cetcs.kmga.dataManager.entity.global;

import com.cetcs.kmga.dataManager.util.MD5;
import com.fasterxml.jackson.annotation.JsonIgnore;

import java.util.Date;
import java.util.UUID;

/**
 * 代码表类
 *
 * @author xutao
 * @version V1.0 创建时间：2017-09-18 11:50
 *          Copyright 2017 by CETC
 */
public class AlarmCode {


    /**
     * 码表主键ID
     */
    @JsonIgnore
    private String id;

    /**
     * 类型ID
     */
    @JsonIgnore
    private String typeId;

    /**
     * 类型名称
     */
    private String value;

    /**
     * 码值
     */
    private String code;

    /**
     * 父级码值
     */
    private String parentCode;

    public String getValue() {
        return value;
    }

    public void setValue(String value) {
        this.value = value;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getParentCode() {
        return parentCode;
    }

    public void setParentCode(String parentCode) {
        this.parentCode = parentCode;
    }

    public String getTypeId() {
        return typeId;
    }

    public void setTypeId(String typeId) {
        this.typeId = typeId;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getRowKey() {
        String rowKeyStr = "AlarmCode{" +
                "id='" + id + '\'' +
                ", typeId='" + typeId + '\'' +
                ", value='" + value + '\'' +
                ", code='" + code + '\'' +
                ", parentCode='" + parentCode + '\'' +
                '}' + UUID.randomUUID().toString() + new Date().getTime();
        MD5 md5 = new MD5();
        return md5.getMD5ofStr(rowKeyStr);
    }
}
